3.250 \(\int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^3} \, dx\)

Optimal. Leaf size=166 \[ -\frac {\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{f (c-d)^{5/2} (c+d)^{5/2}}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 f \left (c^2-d^2\right )^2 (c+d \sec (e+f x))}+\frac {(b c-a d) \tan (e+f x)}{2 f \left (c^2-d^2\right ) (c+d \sec (e+f x))^2} \]

[Out]

-(3*b*c*d-a*(2*c^2+d^2))*arctanh((c-d)^(1/2)*tan(1/2*e+1/2*f*x)/(c+d)^(1/2))/(c-d)^(5/2)/(c+d)^(5/2)/f+1/2*(-a
*d+b*c)*tan(f*x+e)/(c^2-d^2)/f/(c+d*sec(f*x+e))^2-1/2*(3*a*c*d-b*(c^2+2*d^2))*tan(f*x+e)/(c^2-d^2)^2/f/(c+d*se
c(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.30, antiderivative size = 166, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4003, 12, 3831, 2659, 208} \[ -\frac {\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{f (c-d)^{5/2} (c+d)^{5/2}}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 f \left (c^2-d^2\right )^2 (c+d \sec (e+f x))}+\frac {(b c-a d) \tan (e+f x)}{2 f \left (c^2-d^2\right ) (c+d \sec (e+f x))^2} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + b*Sec[e + f*x]))/(c + d*Sec[e + f*x])^3,x]

[Out]

-(((3*b*c*d - a*(2*c^2 + d^2))*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/((c - d)^(5/2)*(c + d)^(5/
2)*f)) + ((b*c - a*d)*Tan[e + f*x])/(2*(c^2 - d^2)*f*(c + d*Sec[e + f*x])^2) - ((3*a*c*d - b*(c^2 + 2*d^2))*Ta
n[e + f*x])/(2*(c^2 - d^2)^2*f*(c + d*Sec[e + f*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 4003

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> -Simp[((A*b - a*B)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 - b^2)), x] + Dis
t[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(m + 1)*Simp[(a*A - b*B)*(m + 1) - (A*b - a*B
)*(m + 2)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] &
& LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{(c+d \sec (e+f x))^3} \, dx &=\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\int \frac {\sec (e+f x) (-2 (a c-b d)-(b c-a d) \sec (e+f x))}{(c+d \sec (e+f x))^2} \, dx}{2 \left (c^2-d^2\right )}\\ &=\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}+\frac {\int \frac {\left (-3 b c d+a \left (2 c^2+d^2\right )\right ) \sec (e+f x)}{c+d \sec (e+f x)} \, dx}{2 \left (c^2-d^2\right )^2}\\ &=\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac {\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \int \frac {\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{2 \left (c^2-d^2\right )^2}\\ &=\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac {\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \int \frac {1}{1+\frac {c \cos (e+f x)}{d}} \, dx}{2 d \left (c^2-d^2\right )^2}\\ &=\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}-\frac {\left (3 b c d-a \left (2 c^2+d^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+\frac {c}{d}+\left (1-\frac {c}{d}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d \left (c^2-d^2\right )^2 f}\\ &=\frac {\left (2 a c^2-3 b c d+a d^2\right ) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{(c-d)^{5/2} (c+d)^{5/2} f}+\frac {(b c-a d) \tan (e+f x)}{2 \left (c^2-d^2\right ) f (c+d \sec (e+f x))^2}-\frac {\left (3 a c d-b \left (c^2+2 d^2\right )\right ) \tan (e+f x)}{2 \left (c^2-d^2\right )^2 f (c+d \sec (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.98, size = 172, normalized size = 1.04 \[ \frac {\frac {\left (a d \left (d^2-4 c^2\right )+b c \left (2 c^2+d^2\right )\right ) \sin (e+f x)}{c (c-d)^2 (c+d)^2 (c \cos (e+f x)+d)}-\frac {2 \left (a \left (2 c^2+d^2\right )-3 b c d\right ) \tanh ^{-1}\left (\frac {(d-c) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\left (c^2-d^2\right )^{5/2}}+\frac {d (a d-b c) \sin (e+f x)}{c (c-d) (c+d) (c \cos (e+f x)+d)^2}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + b*Sec[e + f*x]))/(c + d*Sec[e + f*x])^3,x]

[Out]

((-2*(-3*b*c*d + a*(2*c^2 + d^2))*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(c^2 - d^2)^(5/2) + (d
*(-(b*c) + a*d)*Sin[e + f*x])/(c*(c - d)*(c + d)*(d + c*Cos[e + f*x])^2) + ((a*d*(-4*c^2 + d^2) + b*c*(2*c^2 +
 d^2))*Sin[e + f*x])/(c*(c - d)^2*(c + d)^2*(d + c*Cos[e + f*x])))/(2*f)

________________________________________________________________________________________

fricas [B]  time = 0.54, size = 752, normalized size = 4.53 \[ \left [\frac {{\left (2 \, a c^{2} d^{2} - 3 \, b c d^{3} + a d^{4} + {\left (2 \, a c^{4} - 3 \, b c^{3} d + a c^{2} d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (2 \, a c^{3} d - 3 \, b c^{2} d^{2} + a c d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {c^{2} - d^{2}} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + 2 \, {\left (b c^{4} d - 3 \, a c^{3} d^{2} + b c^{2} d^{3} + 3 \, a c d^{4} - 2 \, b d^{5} + {\left (2 \, b c^{5} - 4 \, a c^{4} d - b c^{3} d^{2} + 5 \, a c^{2} d^{3} - b c d^{4} - a d^{5}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, {\left ({\left (c^{8} - 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} - c^{2} d^{6}\right )} f \cos \left (f x + e\right )^{2} + 2 \, {\left (c^{7} d - 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} - c d^{7}\right )} f \cos \left (f x + e\right ) + {\left (c^{6} d^{2} - 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} - d^{8}\right )} f\right )}}, \frac {{\left (2 \, a c^{2} d^{2} - 3 \, b c d^{3} + a d^{4} + {\left (2 \, a c^{4} - 3 \, b c^{3} d + a c^{2} d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (2 \, a c^{3} d - 3 \, b c^{2} d^{2} + a c d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) + {\left (b c^{4} d - 3 \, a c^{3} d^{2} + b c^{2} d^{3} + 3 \, a c d^{4} - 2 \, b d^{5} + {\left (2 \, b c^{5} - 4 \, a c^{4} d - b c^{3} d^{2} + 5 \, a c^{2} d^{3} - b c d^{4} - a d^{5}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (c^{8} - 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} - c^{2} d^{6}\right )} f \cos \left (f x + e\right )^{2} + 2 \, {\left (c^{7} d - 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} - c d^{7}\right )} f \cos \left (f x + e\right ) + {\left (c^{6} d^{2} - 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} - d^{8}\right )} f\right )}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="fricas")

[Out]

[1/4*((2*a*c^2*d^2 - 3*b*c*d^3 + a*d^4 + (2*a*c^4 - 3*b*c^3*d + a*c^2*d^2)*cos(f*x + e)^2 + 2*(2*a*c^3*d - 3*b
*c^2*d^2 + a*c*d^3)*cos(f*x + e))*sqrt(c^2 - d^2)*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 + 2*s
qrt(c^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2
)) + 2*(b*c^4*d - 3*a*c^3*d^2 + b*c^2*d^3 + 3*a*c*d^4 - 2*b*d^5 + (2*b*c^5 - 4*a*c^4*d - b*c^3*d^2 + 5*a*c^2*d
^3 - b*c*d^4 - a*d^5)*cos(f*x + e))*sin(f*x + e))/((c^8 - 3*c^6*d^2 + 3*c^4*d^4 - c^2*d^6)*f*cos(f*x + e)^2 +
2*(c^7*d - 3*c^5*d^3 + 3*c^3*d^5 - c*d^7)*f*cos(f*x + e) + (c^6*d^2 - 3*c^4*d^4 + 3*c^2*d^6 - d^8)*f), 1/2*((2
*a*c^2*d^2 - 3*b*c*d^3 + a*d^4 + (2*a*c^4 - 3*b*c^3*d + a*c^2*d^2)*cos(f*x + e)^2 + 2*(2*a*c^3*d - 3*b*c^2*d^2
 + a*c*d^3)*cos(f*x + e))*sqrt(-c^2 + d^2)*arctan(-sqrt(-c^2 + d^2)*(d*cos(f*x + e) + c)/((c^2 - d^2)*sin(f*x
+ e))) + (b*c^4*d - 3*a*c^3*d^2 + b*c^2*d^3 + 3*a*c*d^4 - 2*b*d^5 + (2*b*c^5 - 4*a*c^4*d - b*c^3*d^2 + 5*a*c^2
*d^3 - b*c*d^4 - a*d^5)*cos(f*x + e))*sin(f*x + e))/((c^8 - 3*c^6*d^2 + 3*c^4*d^4 - c^2*d^6)*f*cos(f*x + e)^2
+ 2*(c^7*d - 3*c^5*d^3 + 3*c^3*d^5 - c*d^7)*f*cos(f*x + e) + (c^6*d^2 - 3*c^4*d^4 + 3*c^2*d^6 - d^8)*f)]

________________________________________________________________________________________

giac [B]  time = 1.95, size = 418, normalized size = 2.52 \[ \frac {\frac {{\left (2 \, a c^{2} - 3 \, b c d + a d^{2}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, c + 2 \, d\right ) + \arctan \left (-\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )}}{{\left (c^{4} - 2 \, c^{2} d^{2} + d^{4}\right )} \sqrt {-c^{2} + d^{2}}} - \frac {2 \, b c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 4 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - b c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + b c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, b d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, b c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 4 \, a c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b c^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 3 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \, b d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (c^{4} - 2 \, c^{2} d^{2} + d^{4}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c - d\right )}^{2}}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="giac")

[Out]

((2*a*c^2 - 3*b*c*d + a*d^2)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(-2*c + 2*d) + arctan(-(c*tan(1/2*f*x + 1/2*
e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))/((c^4 - 2*c^2*d^2 + d^4)*sqrt(-c^2 + d^2)) - (2*b*c^3*tan(1/2*
f*x + 1/2*e)^3 - 4*a*c^2*d*tan(1/2*f*x + 1/2*e)^3 - b*c^2*d*tan(1/2*f*x + 1/2*e)^3 + 3*a*c*d^2*tan(1/2*f*x + 1
/2*e)^3 + b*c*d^2*tan(1/2*f*x + 1/2*e)^3 + a*d^3*tan(1/2*f*x + 1/2*e)^3 - 2*b*d^3*tan(1/2*f*x + 1/2*e)^3 - 2*b
*c^3*tan(1/2*f*x + 1/2*e) + 4*a*c^2*d*tan(1/2*f*x + 1/2*e) - b*c^2*d*tan(1/2*f*x + 1/2*e) + 3*a*c*d^2*tan(1/2*
f*x + 1/2*e) - b*c*d^2*tan(1/2*f*x + 1/2*e) - a*d^3*tan(1/2*f*x + 1/2*e) - 2*b*d^3*tan(1/2*f*x + 1/2*e))/((c^4
 - 2*c^2*d^2 + d^4)*(c*tan(1/2*f*x + 1/2*e)^2 - d*tan(1/2*f*x + 1/2*e)^2 - c - d)^2))/f

________________________________________________________________________________________

maple [A]  time = 0.59, size = 236, normalized size = 1.42 \[ \frac {-\frac {2 \left (-\frac {\left (4 a c d +a \,d^{2}-2 c^{2} b -b c d -2 d^{2} b \right ) \left (\tan ^{3}\left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{2 \left (c -d \right ) \left (c^{2}+2 c d +d^{2}\right )}+\frac {\left (4 a c d -a \,d^{2}-2 c^{2} b +b c d -2 d^{2} b \right ) \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{2 \left (c +d \right ) \left (c^{2}-2 c d +d^{2}\right )}\right )}{\left (\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) c -\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d -c -d \right )^{2}}+\frac {\left (2 a \,c^{2}+a \,d^{2}-3 b c d \right ) \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c^{4}-2 c^{2} d^{2}+d^{4}\right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^3,x)

[Out]

1/f*(-2*(-1/2*(4*a*c*d+a*d^2-2*b*c^2-b*c*d-2*b*d^2)/(c-d)/(c^2+2*c*d+d^2)*tan(1/2*e+1/2*f*x)^3+1/2*(4*a*c*d-a*
d^2-2*b*c^2+b*c*d-2*b*d^2)/(c+d)/(c^2-2*c*d+d^2)*tan(1/2*e+1/2*f*x))/(tan(1/2*e+1/2*f*x)^2*c-tan(1/2*e+1/2*f*x
)^2*d-c-d)^2+(2*a*c^2+a*d^2-3*b*c*d)/(c^4-2*c^2*d^2+d^4)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*x)*(c-d)/
((c+d)*(c-d))^(1/2)))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?`
 for more details)Is 4*c^2-4*d^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 4.99, size = 250, normalized size = 1.51 \[ \frac {\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d^2+2\,b\,c^2+2\,b\,d^2-4\,a\,c\,d-b\,c\,d\right )}{\left (c+d\right )\,\left (c^2-2\,c\,d+d^2\right )}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (2\,b\,c^2-a\,d^2+2\,b\,d^2-4\,a\,c\,d+b\,c\,d\right )}{{\left (c+d\right )}^2\,\left (c-d\right )}}{f\,\left (2\,c\,d-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,c^2-2\,d^2\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (c^2-2\,c\,d+d^2\right )+c^2+d^2\right )}+\frac {\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,c-2\,d\right )\,\left (c^2-2\,c\,d+d^2\right )}{2\,\sqrt {c+d}\,{\left (c-d\right )}^{5/2}}\right )\,\left (2\,a\,c^2-3\,b\,c\,d+a\,d^2\right )}{f\,{\left (c+d\right )}^{5/2}\,{\left (c-d\right )}^{5/2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b/cos(e + f*x))/(cos(e + f*x)*(c + d/cos(e + f*x))^3),x)

[Out]

((tan(e/2 + (f*x)/2)*(a*d^2 + 2*b*c^2 + 2*b*d^2 - 4*a*c*d - b*c*d))/((c + d)*(c^2 - 2*c*d + d^2)) - (tan(e/2 +
 (f*x)/2)^3*(2*b*c^2 - a*d^2 + 2*b*d^2 - 4*a*c*d + b*c*d))/((c + d)^2*(c - d)))/(f*(2*c*d - tan(e/2 + (f*x)/2)
^2*(2*c^2 - 2*d^2) + tan(e/2 + (f*x)/2)^4*(c^2 - 2*c*d + d^2) + c^2 + d^2)) + (atanh((tan(e/2 + (f*x)/2)*(2*c
- 2*d)*(c^2 - 2*c*d + d^2))/(2*(c + d)^(1/2)*(c - d)^(5/2)))*(2*a*c^2 + a*d^2 - 3*b*c*d))/(f*(c + d)^(5/2)*(c
- d)^(5/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (a + b \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{\left (c + d \sec {\left (e + f x \right )}\right )^{3}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+b*sec(f*x+e))/(c+d*sec(f*x+e))**3,x)

[Out]

Integral((a + b*sec(e + f*x))*sec(e + f*x)/(c + d*sec(e + f*x))**3, x)

________________________________________________________________________________________